package com.eastfair.config.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 表单校验实体类
 * Date:2021/8/27
 * Time:10:53
 *
 * @author zjn
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ApiModel(value = "FormFieldCheckDTO", description = "表单校验实体类")
public class FormFieldCheckDTO implements Serializable {

    /**
     * 校验标识 表单校验
     */
    public interface VerifyFormFieldCheck {
    }

    private static final long serialVersionUID = 1L;

    /**
     * 需要校验的实体
     */
    @ApiModelProperty(value = "需要校验的实体")
    @NotNull(groups = {VerifyFormFieldCheck.class})
    private Object object;

    /**
     * 需要校验的实体类名
     */
    @ApiModelProperty(value = "需要校验的实体类名")
    @NotBlank(groups = {VerifyFormFieldCheck.class})
    private String className;

    /**
     * 获取表单的条件
     */
    @ApiModelProperty(value = "获取表单的条件")
    @NotNull(groups = {VerifyFormFieldCheck.class})
    private FormFieldDTO formFieldDTO;
}
